﻿var screen_div = document.getElementById('screen');
var gs = 0;
var yw = 1;
var iid = null;
var ygdwz = 0;
var gdsz = null;
var startGd = function(){
    if(yw == 0)return;
    screen_div.innerHTML = '';
    yw = 0;
    gs = 0;
    Gd(0);
    gdsz = setTimeout(function(){
        gdsz = null;
    },500);
}
var Gd = function(a){
    var zm = document.createElement('div');
    var xyg = 0;
    if(names[a].indexOf('[dbt]') != -1){
        zm.setAttribute('class','zmdbt');
    }else if(names[a].indexOf('[bt]') != -1){
        zm.setAttribute('class','zmbt');
    }else{
        
        zm.setAttribute('class','zm');
    }
    zm.innerHTML = names[a].replace(/\[d?bt\]/g,'');
    if(zm.innerHTML == '')zm.innerHTML = '<br />';
    zm.setAttribute('onclick','startGd();');
    zm.style.bottom = '0px';
    zm.style.width = '100%';
    screen_div.appendChild(zm);
    gs ++;
    a ++;
    if(a < names.length){
        Gd(a);
    }else{
        iid = setInterval(function(){
            var gdwz = $(document).scrollTop();
            $(document).scrollTop(gdwz + 1);
            if(gdwz != ygdwz && ygdwz != 0 && gdsz == null){
                clearInterval(iid);
                iid = null;
            }
            ygdwz = gdwz + 1;
        },15);
        return;
    }
}
startGd();
